<template>
  <div>
    <h1>{{ title }}</h1>
    <p v-for="items in list" v-on:click="showDetail(items)">
      {{ items.name }}
    </p>
    <button v-on:click="testLink">测试链接</button>
  </div>
</template>
<script>
import axios from 'axios'
module.exports = {
  data: function (){
    return {
      title: '404',
      list: [
        {
          id: 1,
          name: 'zhangsan'
        },{
          id: 2,
          name: 'lisi'
        },{
          id: 3,
          name: 'wangwu'
        },
      ]
    }
  },
  methods: {
    showDetail: function(items){
      console.log('当前点击对象是=>',items)
    },
    testLink: function(){
      axios.get("http://localhost:3000/test/getUserinfo?id=1024").then(function (response) {
        console.log(response);
      }).catch(function (error) {
        console.log(error);
      }); 
    }
  }
}
</script>
